#!/usr/bin/env python
# -*- coding: utf-8 -*-

# @Time     :2020/09/12
# @Author   :Changshu
# @File     :test.py


from collections import deque


# n=4
# dp1=[0]*n
# dp2=[0 for _ in range(n)]
# print(dp1)
# print(dp2)


# 逆置字符串
# str='abcde'
# s=str[::-1]
# print(s)

# 过滤字符串，只保留数字和字母
# s='Pyth on123-'
# s1=''.join(filter(str.isalnum,s)).lower()
# print(s1)

# 异或
# a=1^2
# b=a^2
# print(b)

# 将list转化为字典
from collections import Counter
# nums=[1,2,3,4,5,6]
# hashmap=Counter(nums)
# # s=sum(nums)
# # s=set(nums)
# print(hashmap)


'''测试字典中能否放入对象
class ListNode:
	def __init__(self,x):
		self.val=x
		self.next=None

if __name__ == '__main__':
	head=ListNode(1)
	head.next=ListNode(2)
	head.next.next=ListNode(3)

	d={head:head.val,head.next:head.next.val,head.next.next:head.next.next.val}
	print(d)	证实了字典中可以放class
'''

'''
l=[1,2,3,4,5]
l.pop(0)
print(l)
'''

'''
#测试hash功能
nums=[0,1,1,2,3,3,2]
print(Counter(nums))
'''

'''测试ord函数
print(ord('a'))
'''

# print([1]*5)

# nums=[1,2,3,4,5]
# print(1 in nums)


data=deque([1,2,3,4])
a=data.pop()
print(a)
print(data)
print(len(data))
